package com.kantboot.tool.area.domain.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;

/**
 * 国家或地区实体类
 * @author 方某方
 */
@Entity
@Getter
@Setter
@Table(name = "tool_state_area")
@Accessors(chain = true)
@EntityListeners(AuditingEntityListener.class)
@DynamicUpdate
@DynamicInsert
public class ToolStateArea implements Serializable {

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 国家或地区名称
     */
    @Column(name = "t_name")
    private String name;

    /**
     * 国家或地区编码
     * ISO 3166-1
     */
    @Column(name = "t_code",length = 64,unique = true)
    private String code;

    /**
     * 含几级行政区级别
     * 最高3级
     */
    @Column(name = "ad_level")
    private Integer adLevel;

    /**
     * 1级行政区称呼
     */
    @Column(name = "ad_level_1_name")
    private String adLevel1Name;

    /**
     * 2级行政区称呼
     */
    @Column(name = "adLevel_2_name")
    private String adLevel2Name;

    /**
     * 3级行政区称呼
     */
    @Column(name = "ad_level_3_name")
    private String adLevel3Name;

    /**
     * 备注
     */
    @Column(name = "t_remark")
    private String remark;

    /**
     * 手机号码区号
     */
    @Column(name = "phone_area_code")
    private String phoneAreaCode;

}